From: mru <mru@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Date: Wed, 15 Jul 2009 08:22:06 +0000 (+0000)
Subject: Use normal check_func test for math functions
X-Git-Url: http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff_plain;h=9899a2f3353c19bebf6d1e94eaa526a2a1fece95

Use normal check_func test for math functions

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19434 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

This patch avoid a funny FTBFS on armel machines that do not have a FPU:
The check_exec function tries to execute the binary to check for their
functioning. On armel, llrint (and only that function) is implemented
using FPU instruction, which makes this test fail and causes HAVE_LLRINT
to be not defined. Since it is defined in math.h anyways, the build fails with:

gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/tmp/buildd/ffmpeg-0.5+svn20090706" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -I/tmp/buildd/ffmpeg-0.5+svn20090706/debian/include -mfpu=neon -mfloat-abi=softfp -fPIC -DPIC -std=c99 -fomit-frame-pointer -march=armv7-a -pthread -I/usr/include/dirac -I/usr/include/schroedinger-1.0 -I/usr/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -O3 -fno-math-errno -fno-signed-zeros          -c -o libavfilter/allfilters.o /tmp/buildd/ffmpeg-0.5+svn20090706/libavfilter/allfilters.c
In file included from /tmp/buildd/ffmpeg-0.5+svn20090706/libavutil/common.h:283,
                 from /tmp/buildd/ffmpeg-0.5+svn20090706/libavutil/avutil.h:56,
                 from /tmp/buildd/ffmpeg-0.5+svn20090706/libavcodec/avcodec.h:30,
                 from /tmp/buildd/ffmpeg-0.5+svn20090706/libavfilter/avfilter.h:38,
                 from /tmp/buildd/ffmpeg-0.5+svn20090706/libavfilter/allfilters.c:22:
/tmp/buildd/ffmpeg-0.5+svn20090706/libavutil/internal.h:276: error: static declaration of 'llrint' follows non-static declaration
make[1]: *** [libavfilter/allfilters.o] Error 1

---

--- a/configure
+++ b/configure
@@ -1984,13 +1984,12 @@ done
 
 check_lib math.h sin -lm
 
-# test for C99 functions in math.h
-for func in llrint lrint lrintf round roundf truncf; do
-    check_exec <<EOF && enable $func || disable $func
-#include <math.h>
-int main(void) { return ($func(3.999f) > 0)?0:1; }
-EOF
-done
+check_func llrint
+check_func lrint
+check_func lrintf
+check_func round
+check_func roundf
+check_func truncf
 
 # these are off by default, so fail if requested and not available
 enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
